﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:lakana="clr-namespace:GasyTek.Lakana.Navigation.Controls">

    <!-- WindowControl styles -->

    <Style x:Key="{x:Static lakana:WindowControl.CloseButtonStyleKey}"
           TargetType="Button">
        <Setter Property="Width"
                Value="30" />
        <Setter Property="Height"
                Value="30" />
        <Setter Property="Content"
                Value="x" />
        <Setter Property="Foreground"
                Value="Black" />
    </Style>

    <Style x:Key="{x:Static lakana:WindowControl.TitleStyleKey}"
           TargetType="Label">
        <Setter Property="Foreground"
                Value="Black" />
    </Style>

    <Style x:Key="{x:Type lakana:WindowControl}"
           TargetType="{x:Type lakana:WindowControl}">
        <Setter Property="BorderBrush"
                Value="#6A38E5" />
        <Setter Property="BorderThickness"
                Value="2" />
        <Setter Property="Background"
                Value="White" />
        <Setter Property="Width" Value="800"></Setter>
        <Setter Property="Height" Value="600"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type lakana:WindowControl}">
                    <Border x:Name="outerBorder"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="2"
                            Padding="10"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Width="{TemplateBinding Width}"
                            Height="{TemplateBinding Height}">
                        <DockPanel>
                            <Grid DockPanel.Dock="Top">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <Label Content="{TemplateBinding Title}"
                                       Style="{DynamicResource {x:Static lakana:WindowControl.TitleStyleKey}}"></Label>
                                <Button x:Name="PART_Close"
                                        Grid.Column="1"
                                        Command="{TemplateBinding CloseCommand}"
                                        Style="{DynamicResource {x:Static lakana:WindowControl.CloseButtonStyleKey}}" />
                            </Grid>
                            <ContentPresenter x:Name="mainContainer"
                                        ContentSource="Content"
                                        ContentTemplate="{TemplateBinding ContentTemplate}"
                                        ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
                        </DockPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>